package by.demchenko.sample.services;

import by.demchenko.sample.datamodel.Course;
import by.demchenko.sample.datamodel.Person;
import by.demchenko.sample.datamodel.Result;
import by.demchenko.sample.datamodel.Schedule;

import javax.persistence.metamodel.SingularAttribute;
import javax.transaction.Transactional;
import java.util.List;

public interface ResultService {

    Result get(Integer id);

    Result get(Person student, Course course);

    List<Result> getResults(SingularAttribute<Result, ?> attr, boolean ascending, int startRecord, int pageSize);

    @Transactional
    void save(Result result);

    @Transactional
    void saveOrUpdate(Result result);

    @Transactional
    void deleteAll();

    void assignAGrade(Person student, Schedule schedule, int grade);

    int getGrade(Person student, Course course);


    List<Result> getGrades(Person student);

    int getCount();

    void delete(Result result);

    List<Result> getGradesByCourse(Schedule schedule);
}